import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios';
import installElementPlus from './plugins/element'
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import './assets/css/icon.css'
import JSEncrypt from 'jsencrypt';
import filters from "@/common/filters.js"
import { getCurrentUserIP } from "@/utils/index.js"



let Base64 = require('js-base64').Base64;
axios.defaults.withCredentials = true;

const app = createApp(App)
app.config.globalProperties.$filters = filters
app.config.globalProperties.$jsEncrypt = JSEncrypt
app.config.globalProperties.$axios = axios

installElementPlus(app)

// 应用启动时获取IP地址并缓存
getCurrentUserIP().catch(error => {
  console.warn('应用启动时获取IP地址失败:', error);
});

app
    .use(Base64)
    .use(store)
    .use(router)
    .use(ElementPlus)
    .mount('#app')